<?php
$this->load->view("header");
?>

<div>
    <h4>所有订单：</h4>
    <table>
        <tr>
            <th width="100px">订单号</th>
            <th width="100px">收货人</th>
            <th width="200px">收货地址</th>
            <th width="100px">订单总金额</th>
            <th width="100px">下单时间</th>
            <th width="100px">收货时间</th>
            <th width="100px">订单状态</th>
            <th width="100px">操作</th>
        </tr>
        <?PHP
        if( $my_order != null )
        foreach($my_order as $order){
            echo "<tr>";
            echo "<td width=\"100px\" align=\"center\">" .$order->order_id. "</td>";
            echo "<td width=\"100px\" align=\"center\">" .$order->consignee_realname. "</td>";
            echo "<td width=\"200px\" align=\"center\">" .$order->address. "</td>";
            echo "<td width=\"100px\" align=\"center\">" .$order->total_money. "</td>";
            echo "<td width=\"100px\" align=\"center\">" .$order->order_time. "</td>";
            if( $order->distributor_confirm == 1 )
                echo "<td width=\"100px\" align=\"center\">" .$order->deliver_time. "</td>";
            else
                echo "<td width=\"100px\" align=\"center\"></td>";
            if( $order->distributor_confirm == 0 )
                echo "<td align=\"center\">等待配送</td>";
            else if( $order->distributor_confirm == 1 && $order->client_confirm == 0 )
                echo "<td align=\"center\">未确认</td>";
            else if( $order->distributor_confirm == 1 && $order->client_confirm == 1 )
                echo "<td align=\"center\">交易成功</td>";
            echo "<td align=\"center\">---</td>";
            echo "</tr>";
        }

        ?>
    </table>
</div>

<?php
$this->load->view("footer");
?>